<?php

namespace app\api\model;

use app\common\model\BaseModel;

class Config extends BaseModel
{
    // 表名
    protected $name = 'config';

    /**
     * 获取所有系统参数
     */
    public static function config(){
        return self::where('name', 'in', 'sys_banner,service_phone,about_us,platform_agreement,user_agreement,privacy_policy,cancel_order,car_guarantee,insurance,logo,guide_notice,avatar,back_image')->column('value', 'name');
    }

    /**
     * 获取单个系统参数
     */
    public static function configFind($where = []){
        return self::where($where)->value('value');
    }
}
